package com.guli.common.handler;

import com.guli.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class EduException  extends  RuntimeException{

    private Integer code ;
    private String message ;


    /**
     * 接受状态码和消息
     * @param code
     * @param message
     */
    public EduException(Integer code, String message) {
        super(message);
        this.message = message ;
        this.code=code;
    }

    /**
     * 接收枚举类型
     * @param resultCodeEnum
     */
    public EduException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "EduException{" +
                "message=" + this.getMessage() +
                ", code=" + code +
                '}';
    }


}
